package com.MediaVaultTest;
import com.MediaVaultTest.UserStore;
import java.util.LinkedList;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.datastore.KeyFactory;
import com.google.appengine.api.blobstore.BlobKey;

@PersistenceCapable
public class Format {
	
	//Primary Key
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key key;
	
	//Value for class
	@Persistent
	private BlobKey blobKey;
	
	@Persistent
	private Long Size;
	
	@Persistent
	private String HTTPmediaType; 
	
	//!! Parent class !!//
	@Persistent
	private Media media;

	public Format(BlobKey blobKey, Long Size, String HTTPmediaType){
		this.blobKey = blobKey;
		this.Size = Size;
		this.HTTPmediaType = HTTPmediaType;
	}
	
	public void setKey(Key key) {
		this.key = key;
	}

	public Key getKey() {
		return key;
	}

	public void setBlobKey(BlobKey blobKey) {
		this.blobKey = blobKey;
	}

	public BlobKey getBlobKey() {
		return blobKey;
	}

	public void setSize(Long size) {
		Size = size;
	}

	public Long getSize() {
		return Size;
	}

	public Media getMedia() {
		return media;
	}

	public void setHTTPmediaType(String hTTPmediaType) {
		HTTPmediaType = hTTPmediaType;
	}
	
	public String getKeyForTrans(){
		return KeyFactory.keyToString(key);
	}

	public String getHTTPmediaType() {
		return HTTPmediaType;
	} 
}
